import tkinter as tk
 
top = tk.Tk()
v = tk.StringVar()
e = tk.Entry(top, textvariable=v)
e.pack(padx=20, pady=20)
 
e.delete(0, 'end')
print(v.get())
e.insert(0, '默认文本...')
print(v.get())
v.set('I love Python!')

top.mainloop()
